package org.discala.samples.complex

import domain.Meal
import domain.MealType._
/**
 * @author Chris Turner
 */
object MealCreator {

  private val container = new DiContainer

  def makeMeal(mealType: MealType, ingredientCount: Int): Meal = {
    container.maker().makeMeal(mealType, ingredientCount);
  }

  def main(args: Array[String]): Unit = {
    if ( args.length != 2 ) {
      println("usage: MealCreator <Hot|Cold> <No of ingredients>")
      return
    }

    var mealType = Hot
    if ( args(0) == "Cold" ) mealType = Cold
    val ingredientCount = args(1).toInt

    val meal = makeMeal(mealType, ingredientCount)
    println("Your meal is: " + meal.description)
  }
}